/**
 * 模拟
 */
public class Leetcode1518 {
    public int numWaterBottles(int numBottles, int numExchange) {
        int wineBottleNumber = numBottles;
        int drinkBottlesNum = numBottles;
        while (wineBottleNumber >= numExchange) {
            int exchange = wineBottleNumber / numExchange;
            drinkBottlesNum += exchange;

            wineBottleNumber = wineBottleNumber % numExchange;
            wineBottleNumber += exchange;
        }

        return drinkBottlesNum;
    }
}
